from inference_factory import inference_engine_factory
from result import Result
from typing import List

class YOLOInferenceFramework:
    def __init__(self, device_type: str):
        self.engine = inference_engine_factory(device_type)

    def load_model(self, model_path: str, **kwargs) -> bool:
        """Loads the model using the specified backend."""
        return self.engine.load_model(model_path)

    def infer_local_image(self, img_path: str, **kwargs) -> List[Result]:
        """Runs inference and returns results in a unified format."""
        return self.engine.run_inference(img_path)
